7. processing and sorting machine generic device integration 7
因此,在我们的上一个视频中,我们设法使用通用设备获得了一台完全工作的机器,现在我们需要继续检测和诊断项目的这一部分。
So in our last video, we managed to get a completely working machine using our generic devices, and right now we need to move on to the to detection and to diagnose this part of the project.
首先,我想对我们编写的代码进行一些修改,以便使其更加连贯。
First, I would like to make some a little modification to the code that we wrote in order to make it more coherent here.
因此,对于我们的通用设备,我们没有做得很好的一件事是在提取站中,在提取站中,我们需要,嗯,实际上是在 C20 中。
So one thing that we did not in a good way for our generic device is in the extraction station, in the extraction station, we need to, um, actually be here in C20.
我们向前移动了设备,因此我们启用了该设备。
We moved the device forward, so we enabled the device.
我们不会等待设备能够。
And we don't wait for the device to be able.
相反,我们只是在这里等待产品。
We instead we just wait for the product here.
对于通用设备来说,这实际上是不连贯的。
This is actually not coherent for the generic device.
所以我们需要进行一点修改。
So we need to carry out a little modification.
因此,我将在这里编写必须启用的活塞设备,而不是等待水平上的产品。
So I will right here that instead of waiting for the product on the level, I will write the piston device, that device that must be enabled.
那么这样一来,我们就会知道贝斯顿是完全向前和的。
So in this way, we will know that Beston is completely forward and.
这里。
Here.
在这里,这就足够了,因为我们不应该依赖审查器来控制活塞的运动,我们实际上只需要依赖活塞的东西。
Here, this is enough, because we shall not rely on the censor to control the movement of the piston, we actually just need to rely on the on the Pistons stuff.
那么让我们回到程序的折叠部分。
So let's get back into the fold part of our program.
因此,让我们进入我们的主机,进入我们的模块化主程序,我们将从思考以及如何管理设备的力量开始。
So let's get into our main machine, into our main program, modular, and we shall start by thinking and how to manage the force of the devices.
首先,我们,嗯,我们想要使用的第一种方法是以类似的方式实际处理力以及紧急停止。
First of all, we, um, the first approach that we would like to use is to actually handle the force in a similar way and all of an emergency stop.
因此,每当发现故障时,我们都要对机器进行紧急停车。
So whenever a fault is detected, we shall carry out an emergency stop for the machine.
所以我将在这里创建第四个变量。
So I will create here a fourth variable.
如果检测到故障,则该值为 true,而只要没有故障或现有故障已重置(使用机器中的重置按钮),该值就会变为 false。
That will be true if a fault has been detected and it will become false whenever if there are no faults or if an existing fault has been reset, that the using our reset button that we have here in our machine.
因此,我们可以在这里做什么,以便像紧急停止一样管理它,我们将在这里直到我们的紧急管理,主程序的一部分和/或紧急按钮或故障的声明。
So what we can do here in order to manage it like an emergency stop, we will right here until our emergency management, part of the main program and or in statement for emergency button or fault.
如果其中之一成立,状态将设置为零。
If one of this becomes true, the state will be set to zero.
然后我们需要将信息传递到车站来管理与紧急情况相同的事情。
Then we need to pass the information to the station to manage the same thing as an emergency.
因此,我将在这里写的是紧急按钮或 falta,以便在完整的触须变为真实时以相同的方式实际管理它。
So what I will write here is emergency button or falta in order to actually manage it in the same way this way whenever the full barbel becomes true.
I 将进行紧急停止。
I an emergency stop will be carried out.
现在我们需要纠正。
Now we need to right.
什么时候需要控制这种可行的情况?
When does this hold viable needs to be controlled?
所以这里我们需要在出现错误时让它变为真。
So here we will need we need it to become true whenever there is a fault.
因此,我将在这里打开我们的通用设备列表。
So I will open up our list of our generic devices here.
如果你还记得这里的通用设备,你知道,设备,我们有一个称为输出的设备,其类型为 in,然后设备为,嗯,设备故障。
If and if you if you remember in our generic devices here, you know, devices, we have a device called output that is whose type is in and then devices are in, um, device fault.
所以我们需要检查它们是否不等于零。
So we need to check if they are not equal to zero.
如果这些设备之一的下降不等于零,则意味着该设备正在检测到故障。
If one of these device falls is not equal to zero, it means that the device is detecting a fault.
所以我在这里。
So here I am.
正确的。
Right.
如果这个设备,那个设备的故障是不同的。
If this device, that device fault is different from.
那我就写无错吧。
I will write no fault then.
我需要做的是将折叠可行设置为 true。
What I need to do is set to the fold viable equal to true.
我们需要为所有设备添加条件。
We need to add the conditions for all of our devices.
所以我要做的就是简单地在此处添加您的声明。
So what I will do is simply add in your statement here.
我将复制这部分。
And I will copy this part.
我们有九台设备,我将复制九次,然后更改设备的名称。
We have nine devices, I will copy this nine times and then I will change the name of the devices.
所以这有点复制和粘贴的工作。
So this is a bit of a copy and paste work.
因此,我们可以简单地将设备的每个名称复制并粘贴到此处。
So we can simply copy and paste every name of the device here.
我会很快完成,如果你需要时间,可以。
I will do it quite quickly, if you need time, you can.
按照你自己的节奏来做,这样,如果我们检测到需要删除最后一个或者如果我们检测到任何设备上有故障,我们只需设置字段变量即可。
Do it on your own pace, so in this way, if we detect so we need to remove the last or if we detect a fault on any device, we simply set the field variable through.
这是一种相当简单的故障管理方法。
This is a rather simplistic way to manage faults.
稍后,我们将看到管理信息、信号和警告的结构化方法,我们可以将其集成到任何机器产品上。
Later on, we will see structural way to manage the information, signals and warnings that we can integrate on any machine product.
但现在,让我们从这个开始。
But for now, let's start with this.
因此,只要存在默认值,我们就需要将默认变量设置为 through,并且如果按下重置按钮,则需要重置它以强制执行。
So we need to set the default variable to through whenever there is default and we need to reset it to force if the reset button is being pressed.
所以我们会写如果有一个重置按钮,那么fall将变为false。
So we will write if a reset button, then fall shall become false.
好的,现在让我们尝试用我们的程序上网看看。
OK, so now let's try to go online with our program and see.
如果某个设备现在进入完整状态,因为到目前为止,我们实际上还没有管理其他一些设备,所以可能会发生如果我们没有正确设置设备,某些设备的设备设置,是的,由于设备配置错误,其中一些可能会进入默认状态,而不是我的意思。
If some device goes into a full state right now, because up to now, we didn't actually manage for some further devices, so it may happen that if we didn't properly set the device, the device settings for some devices, yeah, it may happen that some of them go into a default state without I mean, because of misconfiguration of the device.
例如,如果我们在这里设置。
For instance, if we set here.
在某些设备上。
On some devices.
这是肌肉激活时间。
It is muscle activation time.
这将导致设备折叠,因为它想要在,呃,它需要的时候检测到正确的传感器。
This will lead to a device fold because it wanted detected the correct sensor in, uh, in the time that it, uh, it needs so.
让我们回到可视化,看看一切是否正常。
Let's get back to our visualization and see if everything is working.
而且我也会开。
And I will also open.
我们的主要问题在这里,正如您所看到的,所有设备都处于无故障状态。
Our main problem here, and as you can see, all the devices are in a no fault condition.
所以。
So.
现在,我们可以进入第二个可视化,即这里的 Folt 签证,在这里,我们有一组不同的按钮,可用于在我们的机器上模拟 false。
Right now, we can move into our second visualization, that is this Folt visa here and over here, we have a set of different buttons that can be used to simulate false on our machine.
我们有四个不同的传感器和执行器,我们有,呃,呃,绿色按钮和红色按钮,它们允许我们检测力、传感器的值或数据的真或假。
We have four different sensors and actuators, we have both, uh, uh, green button and the red button that allow us to detect the force, the value of either the sensor or the data to true or false.
所以如果我说如果我按下活塞星形位置传感器的绿色按钮。
So if I said if I press this green button for the piston star position sensor.
现在我将在这里强制设置这个野兽传感器的值,始终为真或为假。
I will now force the value of this beast sensor here, always true or false.
我将设置它,然后我们将其强制设置为 false。
I will set it and we force it to false.
所以让我们尝试强制它为 false。
So let's try forcing it to false.
所以当活塞向前移动时我会立即尝试。
So I will try it right now when the piston moves forward.
那是。
That's.
现在,我将其强制设为 false,让我们看看基因装置是否检测到它。
Right now, I will force it to false and let's see if the genetic device detects it.
是的,正如您所看到的,如果我们进入主程序,机器完全停止了。
Yes, as you can see, the machine completely stopped and if we get into our main program.
我们现在实际上将使用 CNN,因为对于通用设备,我的意思是前者,故障不会被记忆在通用设备中。
We will actually right now CNN, because for the generic device, the former I mean, the faults are not memorized within the generic device.
民意调查实际上只是设备所在位置以及我们管理它的方式的函数。
The polls are actually only a function of where the, uh, the device is and actually in the way that we are managing it.
每当我们执行紧急停止时,我们都会禁用该功能块。
Whenever we carry out an emergency stop, we disable the function block.
这样,紧急停止后,任何设备都不会发出任何信号。
So in this way, after an emergency stop is carried out, no device with signal anything.
所以稍后,我们需要一种方法来记住发生了什么故障以及原因,以便显示给用户。
So later on, we will need a way to memorize what fault has happened and why in order to display to the user.
所以现在,您可以看到我们实际上设法,嗯,检测到故障并查看那里有什么,并查看并实际停止机器。
So for now, you can see that we actually managed to, um, detect the fault and see what is there and see and actually stop the machine.
所以如果我回到这里并删除这个按钮。
So if I get back here and I remove this button.
现在,我会的。
Right now, I will.
我可以得到。
I can get.
给我们的。
To our.
呃,抱歉,我们的可视化,Carrie,以这种方式按下重置,默认变量应该变为 false,然后我可以重新开始。
Uh, sorry, our visualisations, Carrie, press a reset in this way, the default variable should get false and then I can start again.
机器。
The machine.
例如,让我们尝试一些其他的傻瓜。
Let's try some other fools here, for instance.
让我们尝试一下。
Let's try and.
让我们尝试一下电梯顶部传感器,让我们将其穿过。
Let's try the elevator top sensor, let's place it through.
正如您所看到的,机器立即进入故障状态,因为遗传装置检测到向下传感器和传感器都将发生故障,而这种情况不可能发生。
As you can see, the machine immediately went into a failed state because the genetic device detected that both the down sensor and the sensor were to and this cannot happen.
所以。
So.
机器突然停止了。
The machine as abruptly stopped.
正如您现在所看到的,这个功能是免费提供给我们的。
As you can see right now, this feature comes to us freely.
我们拥有针对通用设备中实际管理的设备的 Folta 诊断和全面检测功能。
We have this Folta diagnosis and full detection feature for device that is actually managed within the generic device.
而且我们不需要为它编写任何逻辑。
And we do not need to write any logic for it.
我们只需要查看设备的输出即可。
We simply need to look at an output of the device.
这是一个非常非常强大的工具,用于诊断和检测机器问题。
And this is a very, very powerful tool for the diagnosis and to detect the machine problem.
同样在这里,并非所有这些传感器都与设备相关,例如,这里我们有Leever 拾音器的产品。
Also here, not all of these sensors are related to devices, for instance, here we have the product for Leever pickup.
未连接到设备。
That is not connected to a device.
所以到现在为止。
So up to now.
如果我尝试伪造它的值,我们将无法检测到它,因为它是机器传感器而不是属于设备的传感器。
If I try to fake its value, we will not be able to detect it because it is a machine sensor and not a sensor that belongs to to a device.
正如你所看到的,如果我将其值强制设置为 false。
As you can see, if I force its value to false.
机器就会停在那里。
The machine will simply stop there.
因为传感器不起作用,所以我们没有检测到。
Because the sensor doesn't work, we are not detecting that.
所以。
So.
现在,我们已经成功地将基因装置整合到了这里。
Right now, we managed to integrate the genetic device in here.
我现在想,在接下来的几分钟内,我们将尝试构建一个信号管理系统,该系统将帮助我们管理此故障,以便记住它们,对它们进行排序并将它们显示给用户并管理重置每个紧急情况。
I want right now, in the next few minutes, we will try to build a signal management system that will help us to the to manage this fault's in order to memorize them, to sort them and to display them to the user and to manage the reset of every emergency.
对于任何机器来说,这都是非常重要的组件。
This is a very crucial component for any machine.
并且机器需要有食物管理系统和土地管理系统。
And the machine needs to have a food management system and a land management system.
因此,我们将看到如何以一种干净且结构化的方式构建一个来显示所有紧急情况和所有问题。
And so we will see how to build one in a clean and structured way to display all the emergency and all the all the problems.
在那之后,我们就能做到。
And after that, we will be able to.
实际检测故障并查看发生了什么故障。
Actually detect the faults and see what fault is happening.
接下来,我们实际上将编写一些代码来管理所有机器故障,以及通用设备无法管理的所有力量。
So moving on after that, we will actually write some code to manage all the machine faults, all the forces that are not managed by the generic device.
所以我们要离开机器休息一下。
So we'll take a break from the machine.
我们将开发这个组件,然后将其集成到我们的机器中。
We will develop this component and then we will be we will integrate it in our machine and.
稍后,我们将介绍这台机器上可能发生的所有故障。
Later on, so to all the faults that can happen on this machine.